//
//  CPYRadioLeftTableViewCell.m
//  TTMusic
//
//  Created by chenpengyu on 16/4/2.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "CPYRadioLeftTableViewCell.h"

@implementation CPYRadioLeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = COLOR(226, 226, 226);
        self.typeLabel = [[TTMusicBaseLabel alloc] initWithFrame:CGRectZero];
        _typeLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_typeLabel];
    }
    return self;
}
- (void)layoutSubviews {
    _typeLabel.frame = self.bounds;
}
- (void)setRadioModel:(TTMusicRadioModel *)radioModel {
    _radioModel = radioModel;
    _typeLabel.text = radioModel.tag_type_name;
}
#pragma mark - 被选中的时候变色
- (void)setIsCurrentSelected:(BOOL)isCurrentSelected{
    
    _isCurrentSelected = isCurrentSelected;
    if (_isCurrentSelected) {
        self.contentView.backgroundColor = COLOR(239, 238, 239);
        self.typeLabel.textColor = COLOR(223, 132, 119);
    }
    else{
        self.contentView.backgroundColor = COLOR(226, 226, 226);
        self.typeLabel.textColor = COLOR(49, 49, 49);
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
